import request from '@/axios'
import type { CurdData } from './types'
import type { RuleData } from '@/api/logistics/types'

export const getListApi = (params: any) => {
  return request.get({ url: '/admin/advertisement', params })
}

export const getDetApi = (id: string): Promise<IResponse<CurdData>> => {
  return request.get({ url: '/admin/advertisement/' + id, params: { id } })
}

export const deleteDataApi = (param: {}): Promise<IResponse> => {
  return request.delete({ url: `/admin/advertisement`, data: param })
}

export const editInfoApi = (params: any) => {
  return request.put({ url: '/admin/advertisement', params })
}

export const getInfoApi = (id: string): Promise<IResponse<RuleData>> => {
  return request.get({ url: `/admin/advertisement/${id}` })
}

export const createDataApi = (data) => {
  return request.post({ url: '/admin/advertisement', data })
}
export const getEnumApi = (params?: any) => {
  return request.get({ url: '/admin/advertisement/fieldEnum', params })
}
